package linestrategy

import (
	"codejy/analysis/lineanalysis"
	"codejy/globalfunc"
	"codejy/structdef"
)

// 定义计算表达式策略(赋值,算数,逻辑)
type AssignmentExpressionStrategy struct {
}

// 注册策略
func init() {
	// 注册策略
	RegisterStrategy(&AssignmentExpressionStrategy{})
}

// 判断是否是计算表达式
func (f *AssignmentExpressionStrategy) getId() int {
	return lineanalysis.Assignment
}

func (f *AssignmentExpressionStrategy) Execute(threadStore *structdef.ThreadStore) {
	code := threadStore.Code
	globalfunc.ExecuteFunc("CalculateHandler", threadStore, code)
}
